import request from '@/utils/request.js'

/**
 * 获取试卷列表
 * @param {*} val
 * @returns
 */
export const getPaperListAPI = (val) => {
  return request.get('/paper/getPaperList', {
    params: val
  })
}

/**
 * 根据id获取试卷
 * @param {*} val
 * @returns
 */
export const getPaperAPI = (val) => {
  return request.get('/paper/getPaper', {
    params: { id: val }
  })
}

/**
 * 获取学科列表
 * @returns
 */
export const getSubjectListAPI = () => {
  return request.get('/subject/getSubList')
}

/**
 * 提交试卷
 * @param {*} val
 * @returns
 */
export const submitPaperAPI = (val) => {
  return request.post('/paper/submitPaper', val)
}

/**
 * 获取答卷列表
 * @param {*} val
 * @returns
 */
export const getRecordListAPI = (val) => {
  return request.get('/paper/getRecordList', {
    params: val
  })
}

/**
 * 获取答卷
 * @param {*} id
 * @returns
 */
export const getRecordAPI = (id) => {
  return request.get('/paper/getAnswerPaper', {
    params: { id }
  })
}

/**
 * 获取错题列表
 * @param {*} val
 * @returns
 */
export const getQuestionListAPI = (val) => {
  return request.get('/question/getErrorQuestion', {
    params: val
  })
}

/**
 * 上传答卷人人脸
 * @param {*} file
 * @returns
 */
export const uploadAnswerUserFaceAPI = (data) => {
  return request.post('/paper/uploadAnswerUserFace', data)
}
